package com.ajobs.cloudstream.delay.controller;

import com.ajobs.cloudstream.delay.delaycomponent.binder.DelayOutputProducerBinder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *Description
 *
 *@author weijianxun
 */
@RestController
@RequestMapping("/delay")
public class DelayController {

    @Autowired
    private DelayOutputProducerBinder delayOutputProducerBinder;

    @GetMapping("/msg/{info}")
    public String sendDelay(@PathVariable("info") String msg) {
        delayOutputProducerBinder.sendDelayMessage(msg);
        return msg;
    }
}
